* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* Pamphlet Header */
.pamphlet-header {
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #e53935 100%);
    color: white;
    padding: 20px 15px 30px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    width: 100%;
}

.pamphlet-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    word-wrap: break-word;
}

.pamphlet-header .subtitle {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding: 0 10px;
}

.pamphlet-header a {
    display: inline-block;
    font-size: 14px;
    color: #fff;
    opacity: 0.85;
    text-decoration: none;
    transition: opacity 0.3s;
    word-wrap: break-word;
    padding: 0 5px;
}

.pamphlet-header a:hover {
    opacity: 1;
}

.pamphlet-header a i {
    margin-right: 5px;
}

.pharma-icon {
    position: absolute;
    right: 30px;
    top: 20px;
    font-size: 40px;
    opacity: 0.2;
}

/* Main Container */
.main-container {
    display: flex;
    flex: 1;
    padding: 20px 15px;
    gap: 20px;
    max-width: 1500px;
    margin: 0 auto;
    width: 100%;
    min-height: calc(100vh - 200px);
    align-items: flex-start;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(to bottom, #1a237e, #283593);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    height: 100%;
    min-height: 700px;
    position: sticky;
    top: 20px;
    flex-shrink: 0;
}

.sidebar h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    border-bottom: 2px solid #e53935;
    padding-bottom: 8px;
    text-align: center;
    word-wrap: break-word;
}

.dropdown-filter {
    margin-bottom: 15px;
    width: 100%;
}

.dropdown-filter select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background-color: white;
    transition: all 0.3s ease;
    max-width: 100%;
    cursor: pointer;
}

.dropdown-filter select:focus {
    border-color: #e53935;
    box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.2);
    outline: none;
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    max-height: 600px;
    width: 100%;
    padding-left: 6px;
    padding-right: 4px;
    scrollbar-gutter: stable both-edges;
}

.product-list::-webkit-scrollbar {
    width: 8px;
}

.product-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}

.product-list::-webkit-scrollbar-thumb {
    background: rgba(229, 57, 53, 0.85);
    border-radius: 999px;
}

.product-list::-webkit-scrollbar-thumb:hover {
    background: #e53935;
}

.product-item {
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-item:hover {
    background-color: rgba(229, 57, 53, 0.7);
    border-color: rgba(229, 57, 53, 0.5);
}

.product-item.active {
    background-color: #e53935;
    border-color: #e53935;
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    height: 100%;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
    flex: 1;
    overflow-y: auto;
    width: 100%;
}

.product-card {
    background-color: white;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 320px;
    width: 100%;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    border-color: #e53935;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #1a237e, #e53935);
}

.product-image {
    width: 100%;
    height: 230px;
    object-fit: contain;
    object-position: center;
    background-color: #f5f7fb;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 12px;
    max-width: 100%;
}

.product-name {
    font-weight: 600;
    font-size: 16px;
    color: #1a237e;
    margin-bottom: 8px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-details {
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.5;
    flex-grow: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-details span {
    color: #7f8c8d;
    font-weight: 500;
}

.read-more {
    display: inline-block;
    background: linear-gradient(to right, #1a237e, #283593);
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    margin-top: auto;
    word-wrap: break-word;
}

.read-more:hover {
    background: linear-gradient(to right, #283593, #e53935);
    box-shadow: 0 4px 8px rgba(229, 57, 53, 0.3);
}

/* Category Badge */
.category-badge {
    display: inline-block;
    background-color: #e53935;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 10px;
    max-width: 100%;
    word-wrap: break-word;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
    width: 100%;
    grid-column: 1 / -1;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1a237e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    text-align: center;
    padding: 40px;
    color: #e53935;
    font-size: 16px;
    width: 100%;
    grid-column: 1 / -1;
    background-color: #ffebee;
    border-radius: 8px;
}

.error a {
    color: #1a237e;
    text-decoration: none;
    font-weight: 600;
}

.error a:hover {
    text-decoration: underline;
}

.no-results {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    grid-column: 1 / -1;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
    width: 100%;
}

.no-results h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #1a237e;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-container {
        max-width: 100%;
        padding: 20px;
    }
    
    .sidebar {
        width: 250px;
    }
    
    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .main-container {
        padding: 15px;
        gap: 15px;
    }
    
    .sidebar {
        width: 230px;
        padding: 15px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        padding: 10px;
        min-height: auto;
        gap: 10px;
    }
    
    .pamphlet-header {
        padding: 15px 10px 25px;
    }

    .pamphlet-header h1 {
        font-size: 24px;
        padding: 0 10px;
    }
    
    .pamphlet-header .subtitle {
        font-size: 14px;
        padding: 0 15px;
    }

    .pharma-icon {
        display: none;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eaeaea;
        flex-direction: column;
        height: auto;
        min-height: auto;
        max-height: none;
        position: relative;
        top: auto;
        z-index: auto;
        padding: 12px;
        box-shadow: none;
    }
    
    .sidebar h2 {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .dropdown-filter {
        width: 100%;
        margin-bottom: 10px;
    }

    .dropdown-filter select {
        height: 42px;
        font-size: 14px;
    }
    
    .product-list {
        width: 100%;
        max-height: 260px;
        overflow-y: auto;
        overflow-x: hidden;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding-left: 6px;
        padding-right: 4px;
        padding-bottom: 2px;
        padding-top: 2px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .product-item {
        min-width: 0;
        max-width: 100%;
        white-space: normal;
        border: 1px solid rgba(255, 255, 255, 0.35);
        border-radius: 10px;
        text-align: center;
        line-height: 1.25;
    }

    .main-content {
        padding: 15px;
        height: auto;
        min-height: auto;
        max-height: none;
    }

    .product-image {
        height: 190px;
        object-fit: cover;
        object-position: center;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    
    .product-card {
        min-height: auto;
    }
}

@media (max-width: 576px) {
    .main-container {
        padding: 10px;
    }
    
    .pamphlet-header {
        padding: 12px 8px 20px;
    }
    
    .pamphlet-header h1 {
        font-size: 20px;
        line-height: 1.3;
    }
    
    .pamphlet-header .subtitle {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .sidebar {
        padding: 10px;
        border-radius: 10px;
    }
    
    .sidebar h2 {
        font-size: 16px;
        padding-bottom: 4px;
        margin-bottom: 10px;
    }
    
    .dropdown-filter select {
        padding: 8px 12px;
        font-size: 13px;
        height: 38px;
    }
    
    .product-item {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 0;
        max-width: 100%;
    }
    
    .main-content {
        padding: 12px;
        border-radius: 10px;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    
    .product-card {
        padding: 12px;
        min-height: 250px;
    }

    .product-image {
        height: 140px;
        object-fit: cover;
        object-position: center;
    }
    
    .product-name {
        font-size: 13px;
    }
    
    .product-details {
        font-size: 12px;
    }
    
    .read-more {
        padding: 7px 12px;
        font-size: 12px;
    }
    
    .category-badge {
        font-size: 11px;
        padding: 3px 6px;
    }
}

@media (max-width: 420px) {
    .product-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .product-item {
        min-width: 0;
        font-size: 12px;
        padding: 7px 8px;
    }

    .product-image {
        height: 125px;
        object-fit: cover;
        object-position: center;
    }
}
